package utils;

import android.content.Context;

/**
 *  写磁盘数据
 * Created by Administrator on 2016/3/5.
 */
public class PreferenceHelper {

   // 所有站点
    public static final String allPoints = "allPoints";

    Context context;

    public PreferenceHelper(Context context) {
        this.context = context;
    }

    public  String getString(String prefName,String key)
    {
        return context.getSharedPreferences(prefName, Context.MODE_MULTI_PROCESS).getString(key, null);
    }

    public  void putString(String prefName,String key, String value) {
        context.getSharedPreferences(prefName, Context.MODE_MULTI_PROCESS).edit().putString(key, value).commit();
    }

    public boolean contains(String prefName,String key)
    {
        return context.getSharedPreferences(prefName,Context.MODE_MULTI_PROCESS).contains(key);
    }
}
